import java.lang.reflect.Array;
import java.util.Arrays;

public class Test {
    public static int add(int [] array){
        array[0]=1;
        array[1]=2;
        return array[2]=array[1]+array[0];
    }
    public static void main(String[] args) {
        int[] array =new int[3];
        System.out.println(add(array));
    }
    public static void func(int[] a) {
        a[0] = 100;
        System.out.println("a[0] = " + a[0]);
    }
    public static void main10(String[] args) {
        int[] arr = {1, 2, 3,4};
        func(arr);
        System.out.println("arr[0] = " + arr[0]);
    }

    public static void print(int [] array){
        for (int i = 0; i < array.length; i++) {
            System.out.print(array[i]+" ");
        }
        System.out.println();
    }
    public static void main9(String[] args) {
        int[] array ={1,2,3,4,5};
        print(array);

    }

    public static void test2(int [] array2){
        array2 = new int[] {100,200,300,400};
    }
    public static void main8(String[] args) {
        int[] array ={1,2,3,4};
        test2(array);
        printArray(array);
    }
    public static void test1(int [] array1){
       array1[0]=100;
    }

    public static void main7(String[] args) {
       int[] array ={1,2,3,4};
       test1(array);
       printArray(array);
    }
    public static void printArray(int [] array){
        for (int i = 0; i < array.length; i++) {
            System.out.print(array[i]+" ");
        }
        System.out.println();
    }
    public static void main6(String[] args) {
        int a=10;
    }
    public static void print1(int [] array2){
        for (int i = 0; i < array2.length; i++) {
            System.out.println(array2[i]);
        }
    }
    public static void main5(String[] args) {
        int [] array1 = {1,2,3,4};
        print1(array1);

    }
    public static void main4(String[] args) {
        int[] array = {1,2,3,4};
        for(int x :array){
            System.out.println(x);
        }

    }
    public static void main3(String[] args) {
        int[] array = {1,2,3,4};
        for (int i = 0; i < 4; i++) {
            System.out.println(array[i]);
        }
    }
    public static void main2(String[] args) {
        int[]array = new int[]{10, 20, 30, 40, 50};
        System.out.println(array[0]);
        System.out.println(array[1]);
        System.out.println(array[2]);
        System.out.println(array[3]);
        System.out.println(array[4]);
    }
    public static void main1(String[] args) {
        int[] array1= new int[5] ;

        int[] array = {1,2,3};
    }
}
